package com.maysham.tripod.controller.codebase;

import com.maysham.tripod.common.Response;
import com.maysham.tripod.dto.CodeBaseRequest;
import com.maysham.tripod.model.CodeBase;
import com.maysham.tripod.service.CodeBaseService;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/codebase", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class CodebaseController {
    @Resource
    private CodeBaseService codeBaseService;

    @PostMapping("/query")
    public Response<Page<CodeBase>> query(){
        return null;
    }

    @PostMapping("/create")
    public Response<CodeBase> create(@RequestBody CodeBaseRequest request){
        return Response.ok(codeBaseService.create(request));
    }
}
